package security.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import security.service.UserService;

import java.util.List;

/**
 * @author cyt
 * @create 2020-07-17 17:36
 */
@RestController
public class TestController {

    @Autowired
    private UserService userService;
    /**
     * 用户 id 得到全部权限
     * @param id
     * @return
     */
    @GetMapping("/getAllPreById/{id}")
    public List<String> getAllPreById(@PathVariable("id") String id) {
        List<String> permissionsByUserId = userService.findPermissionsByUserId(id);
        return permissionsByUserId;
    }

}
